<template>
  <page-form :x-uri="uri" :bind-options="options" :custom-components="custom">
    <!-- 自定义tab -->
    <template v-slot:page-tabs>
      <tabs :tabs="tabs" />
    </template>
  </page-form>
</template>

<script>
import PageForm from '@public/template/page_form.vue';
import Tabs from '../tabs';
import ChooseCourse from '@/pages/market/coupon/course_card/components/course.vue';
export default {
  components: {
    PageForm,
    Tabs
  },
  data() {
    return {
      uri: '/admin/promotion/bargain/' + this.$route.params.id + '/edit',
      tabs: [
        {
          title: '编辑砍价',
          uri: '/promotion/bargain/' + this.$route.params.id + '/edit',
          meta: {
            permission: 'market.promotion.bargain.edit'
          }
        }
      ],
      options: {
        time: {
          disabledDate: function(time) {
            return time.getTime() + 8.64e7 < Date.now();
          }
        }
      },
      custom: {
        course: ChooseCourse
      }
    };
  }
};
</script>
